Skip to content

Extend file cloning of attachments to ABI.EncodedAttachment.#1616

Merged
grynspan merged 1 commit intomainfrom
jgrynspan/encodedattachment-clonable
Mar 9, 2026
Merged

Extend file cloning of attachments to ABI.EncodedAttachment.#1616
grynspan merged 1 commit intomainfrom
jgrynspan/encodedattachment-clonable

Conversation

@grynspan
Copy link
Contributor

@grynspan grynspan commented Mar 7, 2026

This PR ensures that an ABI.EncodedAttachment instance that's wrapping an instance of AnyAttachable (i.e. one that has not yet been encoded to JSON) will still be able to clone its underlying file where appropriate.

I haven't tried to plumb this through attachments stored solely as file paths because they've already been serialized/deserialized by that point, which implies a slow path anyway. We can revisit that in a future PR if we think it's valuable.

Follow-up to #1590 and #1587.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

This PR ensures that an `ABI.EncodedAttachment` instance that's wrapping an instance of `AnyAttachable` (i.e. one that has not yet been encoded to JSON) will still be able to clone its underlying file where appropriate.

I haven't tried to plumb this through attachments stored solely as file paths because they've already been serialized/deserialized by that point, which implies a slow path anyway. We can revisit that in a future PR if we think it's valuable.
@grynspan grynspan added this to the Swift 6.4.0 (main) milestone Mar 7, 2026
@grynspan grynspan self-assigned this Mar 7, 2026
@grynspan grynspan added the enhancement New feature or request label Mar 7, 2026
@grynspan grynspan added the tools integration 🛠️ Integration of swift-testing into tools/IDEs label Mar 7, 2026
@grynspan grynspan added performance 🏎️ Performance issues attachments/activities 🖇️ Work related to attachments and/or activities cross-import-overlays 🍰 Cross-import overlays (Foundation, Core Graphics, etc.) labels Mar 7, 2026
@grynspan grynspan merged commit 176dbff into main Mar 9, 2026
27 checks passed
@grynspan grynspan deleted the jgrynspan/encodedattachment-clonable branch March 9, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

attachments/activities 🖇️ Work related to attachments and/or activities cross-import-overlays 🍰 Cross-import overlays (Foundation, Core Graphics, etc.) enhancement New feature or request performance 🏎️ Performance issues tools integration 🛠️ Integration of swift-testing into tools/IDEs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants